package com.golf.comms.client;

import java.awt.Frame;

import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;

import com.golf.client.ui.chat.ChatPanel;
import com.golf.comms.Channels;

public class ChatClientAWT extends Frame
{

	/** <code>serialVersionUID</code> for this class. */
	private static final long serialVersionUID = -8860014309713997214L;



	public ChatClientAWT(Client client) throws Throwable
	{
		
		setSize(600,300);
		
		setVisible(true);
		
		ChatPanel p = new ChatPanel();
		add(p);
		
		p.attach(client);
	}
	
	
	
	/**
	 * 
	 * @param args The supplied arguments from the command line.
	 * @throws Throwable 
	 */
	public static final void main(final String[] args) throws Throwable
	{
		
		
		InvokerLocator myLocator = new InvokerLocator("socket://" + args[0] + ":8084");
		
		Client client = new Client(myLocator, Channels.LOBBY_CHAT);
		client.connect();
		

		ChatClientAWT c = new ChatClientAWT(client);
		c.setVisible(true);
	}

}
